<{include file="Public/top.html" }>
</head>
<body>
<div id="warpper">
    <div class="content">
        <form onsubmit="update();return false;" class="ui-form" id="addManagerForm" method="post" >
            <input type="hidden" name="mid" value="<{$mid}>" />
            <div class="topic">关联活动</div>
            <div class="form-box border0 border-box">
                <div class="ui-form-item">
                    <label class="ui-label">关联名称</label>
                    <input type="text" name="title" value="<{$title}>"  class="ui-text" required />
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">关联活动</label>
                    <select name="active"  class="ui-select" >
                        <{html_options options=$eventKv selected=$selectedActive}>
                    </select>
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">关联转盘</label>
                    <select name="turn"  class="ui-select" >
                        <{html_options options=$turnKv selected=$selectedTurn}>
                    </select>
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">活动时间</label>
                    <input style="width: 33%" id="startDate2" name="applyStartTime"  value='<{$applyStartTime}>' class="date ui-select" placeholder="2020-01-01 12:50" type="text" required/>
                    -
                    <input style="width: 33%"  id="endDate2" name="applyEndTime"  value='<{$applyEndTime}>' class="date ui-select" placeholder="2020-01-01 12:50" type="text" required/>
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">获取条件</label>
                    <select name="gotWay"  class="ui-select" >
                        <{html_options options=$gotWayKv selected=$selectedWay}>
                    </select>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">限领次数</label>
                    <input type="number" name="limit" value="<{$limit}>"  class="ui-text" required />
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">消耗积分</label>
                    <input type="number" min="0" name="pointFee" value="<{$pointFee|default:0}>"  class="ui-text" required />
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">活动规则<br />&lt;br /&gt;换行</label>
                    <textarea name="rule"   class="ui-textarea" style="width: 60%"><{$rule}></textarea>
                </div>
            </div>
    <div class="integral_btn-group">
        <input type="submit" value="提交" class="ui-button"/>
        <input type="reset" value="清空" class="ui-button fade-o-butn"/>
    </div>


    </form>

    </div>
</div>

<{include file="Public/foot.html" }>
</body>
</html>
<script>
    datePickter('startDate2','endDate2');

    //提交数据
    function update(){
        var param = $("#addManagerForm").serialize();
        var url = "<{U('connect')}>";
        layer.load()
        $.post(url,param,function(data){
            layer.closeAll();
            if(data.status==0){
                layer.msg(data.msg, {
                    icon: 1,
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function(){
                    parent.window.layer.closeAll()
                });
            }else{
                layer.msg(data.msg);
            }
        },'json');
    }

</script>
